[@plaintext.layout title="QuickView"]
[#-- Watch out for the new line defined along with macro output! --]

h1. Simple macro
[#macro greet]
  <font size="+2">Hello Joe!</font>
[/#macro]
[#-- the end-tag for user-defined directives is mandatory! --]
greeting: <@greet/>

h1. Parameter
[#macro greet person]
  <font size="+2">Hello ${person}!</font>
[/#macro]
greeting: <@greet person="Zemian"/>

[#macro greet person color]
  <font size="+2" color="${color}">Hello ${person}!</font>
[/#macro]
In order: <@greet person="Fred" color="black" /> 
Switched order: <@greet color="black" person="Fred" /> 

h1 Nested content
[#macro border]
  <table border=4 cellspacing=0 cellpadding=4><tr><td>
    [#nested]
  </tr></td></table>
[/#macro]
<@border>The bordered text</@border>

h2. repeated nested content
[#macro do_thrice]
  [#nested]
  [#nested]
  [#nested]
[/#macro]
<@do_thrice>
  Anything.
</@do_thrice>

h2. nested within custom directive
<@border>
  <ul>
  <@do_thrice>
    <li><@greet person="Joe" color="white"/>
  </@do_thrice>
  </ul>
</@border>

h1. Local variable
[#macro repeat count]
  [#local y = "test"]
  [#list 1..count as x]
    ${y} ${count}/${x}: [#nested]
  [/#list]
[/#macro]
<@repeat count=3>${y!"?"} ${x!"?"} ${count!"?"}</@repeat> 
[/@plaintext.layout]
